﻿@model HomeCareLibrary.Models.TasksModel  




 <div class="tab-pages task-tab">
            
              <div class="top-tittle-panel hidden-phone">
                <h4>Personalized for @Model.homename</h4>
              </div>
              <div class="title clearfix mobile-top-head">
                <div class="top-left-panel">
                  <div style="cursor:pointer;" class="top-right-panel-bg" data-toggle="modal" data-target="#myModal"> <span>Other Months</span> <span class="right"> <img class="calender-icon" src="@Url.Content("~/images/mtt-images/calender-icon.png")" alt="calender-icon"> </span> 
                 </div>

                          <!-- Modal -->
<div class="modal fade task-popup" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Other Months</h4>
      </div>
      <div class="modal-body">
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-6">
          @Html.DropDownList("getMonths", null, new { @class = "form-control" }) </div>
            <div class="col-md-6 col-sm-6 col-xs-6">
           @Html.DropDownList("getYear", null, new { @class = "form-control" }) </div>
            </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" id="btnMYDone">Done</button>
      
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
                </div>
                <h1>Routine Tasks</h1>
                  <p>@Model.selectedmonth @Model.selectedyear</p>
                <div class="top-right-panel">
                  <div class="top-right-panel-bg" style="cursor:pointer;"  data-toggle="modal" data-target="#myModalAll"> <span id="spnAllTasks">All</span> <span class="right"><img src="@Url.Content("~/images/mtt-images/icon-menu.png")"></span> </div>
                </div>
              </div>

     <div class="top-tittle-panel visible-phone">
                <h4>Personalized for @Model.homename</h4>
              </div>

              <div class="main-content">
                <div class="mtt-bg">
                  <div class="group-mtt-outer">
                    
                      
                       @foreach (var taskItem in Model.TasksList)
                                                                {
                      <div class="panel-group-mtt clearfix">
                      <div class="media"> 
                         
                          <a href="javascript:void(0);" class="ACR-img"> 
                           
                              @if (taskItem.done_or_not == "Y") 
                              { 
                                  
                           <img src="@Url.Content("~/Images/mtt/checkmark.jpg")"  class="clsimgDone" data-status="@taskItem.done_or_not" data-alt="@Url.Content("~/"+taskItem.display_icon_code)" data-taskcode="@taskItem.task_code" />
                               
                              }
                              else
                              {
                              
                              <img src="@Url.Content("~/"+taskItem.display_icon_code)" class="clsimgDone" data-status="@taskItem.done_or_not" data-alt="@Url.Content("~/Images/mtt/checkmark.jpg")" data-taskcode="@taskItem.task_code" > 
                              }
                                   </a>
                       
                        <div class="media-body">
                        <div class="left-group-panel">
                          <h4 class="media-heading">@taskItem.feature_name</h4>
                          <div class="icon-mtt clearfix">
                            <div class="star pull-left"><img src="@Url.Content("~/images/mtt-images/"+ @taskItem.priority +"_star.png")" alt="@taskItem.priority"> </div>
                            <div class="arrow-icon"><a href="javascript:void(0);"><img class="img-responsive taskDetailClick" src="@Url.Content("~/images/mtt-images/arrow-img.png")" alt="arrow-img" data-taskcode="@taskItem.task_code.Trim()"></a></div>
                          </div>
                          
                              @{int count = 0;
                                count = @taskItem.task_description.Count();
                               }
                            <p>
                                @if(count>60)
                                {
                                
                               <span style="font-size:12px;"> @taskItem.task_description </span>
                                }
                                else
                                {
                                   @taskItem.task_description
                                }
                         </p>
                        </div>
                        
                        </div>
                      </div>
                    </div>
                       }
                       @Html.Hidden("hdnUpdateDone", @Url.Action("TaskDone", "Mtt"))
                         @Html.Hidden("hdnupdateothermonths", @Url.Action("tasks", "Mtt"))


                       @Html.Hidden("hdnselectedmonth", @DateTime.ParseExact(Model.selectedmonth, "MMMM", System.Globalization.CultureInfo.CurrentCulture).Month)
                        @Html.Hidden("hdnselectedyear", @Model.selectedyear)

                  
                  
                  </div>

                     @if (ViewBag.noRecords != string.Empty)
                    {
                    
                         <span id="spsError" style="text-align:center;color:red;padding-top:10px;display:block">
                            @ViewBag.noRecords</span>
                    }
                   


                    
                     
                  <div class="btm-task">
                    <p class="text-center"> Not the perfect tasks for you?
                      Then just change your
                      personalization choices. </p>
                  </div>
                  <br>
                @*    <div class="mtt-button"> <a id="btnTaskPersonalize" class="btn-per" href="@Url.Action("UpdatePersonalization", "Personalization")">Personalize</a> </div>*@
                  
                    
                    <div class="mtt-button">
                        @if (Session["mode"] != null && Session["mode"] == "androidApp")
                        {
                            <button type="button" id="btnTaskPersonalize" class="btn-per" onclick="personalise();">Personalize</button>
                        }
                        else
                        {
                            <a class="btn-per" href="@Url.Action("UpdatePersonalization", "Personalization")">Personalize</a>
                        }
                    </div>
                    <br />
                     @if (Session[HomeCareLibrary.Constants.SessionConstants.SPONSOR_DETAILS]!=null)
    
 {

     {
         var getSponsorDetail = (HomeCareLibrary.Core.Dtos.SponsorInputs345xDto)Session[HomeCareLibrary.Constants.SessionConstants.SPONSOR_DETAILS];
        <div class="personalization-data sponsor-screen-additional">
           <div class=" sponsor_data clearfix">
              <div class="dataset clearfix">
                <div class="header_img">
                <p>@getSponsorDetail.Spon_YourName<br>
                   @getSponsorDetail.Spon_PhoneBan<br>
                    <small>@getSponsorDetail.Spon_Email</small><br><small> @getSponsorDetail.Spon_Web_Add</small></p>
                </div>
                
                <div class="popup_footer_bg">
                 
              </div>
            </div></div></div>
                         }
 } 

                     
                 
                  <br />


                     Session Ids with values:
                      @if (ViewBag.sessionIds != string.Empty)
                      {
                      @ViewBag.sessionIds
                      } <br /><br />

                           <span>
                 Session:
                    @if (ViewBag.getSession != string.Empty)
                    {
                      @ViewBag.getSession
                    }
                      </span>


                           <br /><br />


                     JSON:
                   @if (ViewBag.JsonString != string.Empty)
                   {
                       <h4>@ViewBag.JsonString</h4>
                   }
                      <br /><br />
                         <span style="margin-left:10px;">
                  Request Content-Type:
                    @if (ViewBag.ContentType != string.Empty)
                    {
                      @ViewBag.ContentType
                    }
                      </span>

                      <br /><br />
                         <span style="margin-left:10px;">
                  Request URL:
                    @if (ViewBag.Url != string.Empty)
                    {
                      @ViewBag.Url
                    }
                      </span>
                  
                  
                  <div class="visible-phone sponsor_data sponsor_data-btm">

                       @if (Session[HomeCareLibrary.Constants.SessionConstants.PROMO_CODE] != null)
                       {
                                              <div class="sponsor_data sponsor_data-btm">
                                                  @Html.Partial("SponsorDetailMobileView");
                                                  </div>
                       }

                       </div>
               </div>
              </div>
     <img  style="display:none" src="@Url.Content("~/images/mtt/checkmark.jpg")">

      @*<div id="wait_task" style="display:none;width:100%;z-index: 999;height:100%;position:absolute;top:0; bottom:0;left:0; right:0;padding:2px;background-color: rgba(0, 0, 0, 0.4);">
                    <div style="width: 86px; margin: 27% auto 0px;"><img style="" src='@Url.Content("~/images/demo_wait.gif")'  /><br>Loading..</div></div>*@
     <div class="modal fade task-popup" id="myModalAll" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
    
      <div class="modal-body">
            <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" style="text-align:center;" id="myModalLabelAll">List Display</h4>  
          <br />
          <p  style="text-align:center;">Make you selections below for how  you want your lists displayed:</p>
      </div>
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-6">
          Home:
           </div>
      </div>
          <div class="row">
               <div class="col-md-6 col-sm-6 col-xs-6">
          @if (ViewBag.getSingleHomeName != null && ViewBag.getSingleHomeName != "")
          {
                                    @ViewBag.getSingleHomeName
             
            
          }
          else
          {
              
                                    @Html.DropDownList("getHomeName", null, new { @class = "form-control" })
          }
                    <input type="hidden" name="getSingleHomeName" id="getSingleHomeName" value="@ViewBag.getSingleHomeValue" />
            </div>

          </div>
              <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-6">
          Display:
           </div>
      </div>
          <div class="row">
               <div class="col-md-6 col-sm-6 col-xs-6">
           @Html.DropDownList("getDisplay", null, new { @class = "form-control" })
            </div>

          </div>    <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-6">
          Sort by:
           </div>
      </div>
          <div class="row">
               <div class="col-md-6 col-sm-6 col-xs-6">
           @Html.DropDownList("getSortBy", null, new { @class = "form-control" })
            </div>

          </div>
      <div class="modal-footer">
       
          <button  style="float:left;" type="button" class="btn btn-default" data-dismiss="modal" id="btnMYDoneListCancel">Cancel</button>
      <button style="float:right;" type="button" class="btn btn-default" data-dismiss="modal" id="btnMYDoneList">Done</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
                </div>


       <input type="hidden" value="@Session[HomeCareLibrary.Constants.SessionConstants.MODE]" id="hdnSessionValue" />
            </div>
           
<script type="text/javascript">
    // keep the month and year values in the variables on page load. we will use these values in mtt.js function:$("#btnMYDone")
    var oldMonth = "";
    var oldYear = "";
    var oldHomeNumberTask = "";
    var oldTaskDisplay = "";
    var oldTaskSortBy = "";
    $(function () {
        oldMonth = $("#getMonths").val();
        oldYear = $("#getYear").val();
        if ($("#getSingleHomeName").val() == "") {
            oldHomeNumberTask = $("#getHomeName").val();
        }
        else {
            oldHomeNumberTask = $("#getSingleHomeName").val();
        }
        oldTaskDisplay = $("#getDisplay").val();
        oldTaskSortBy = $("#getSortBy").val();
        //checkscreenWidth();
        checkforIphone();

    });

    //$(window).resize(function () {
    //    checkscreenWidth();
    //});

    //function checkscreenWidth() {

    //    var $window = $(window);
    //    var windowsize = $window.width();
       
    //    if (windowsize < 767) {
    //        $(".mobileMenu").show();
    //    }
    //    else {
    //        $(".mobileMenu").hide();
    //    }
       
    //}

    function checkforIphone()
    {
         if ($("#hdnSessionValue").val() != '') {
             if ($("#hdnSessionValue").val() == "@HomeCareLibrary.Constants.ApplicationModeConstants.IPHONE_APP" || $("#hdnSessionValue").val() == "@HomeCareLibrary.Constants.ApplicationModeConstants.IPAD_APP") {
               
                $(".mobileMenu").show();
            }
        }
        
    }

</script>


  
    
    



